org.eclipse.vtp.framework.interactions.voice.vxml
Class Choice

java.lang.Object
  extended by org.eclipse.vtp.framework.interactions.core.support.Widget
      extended by org.eclipse.vtp.framework.interactions.voice.vxml.Choice
All Implemented Interfaces:
VXMLConstants

public class Choice
extends Widget
implements VXMLConstants

The Choice class represents an option within a Menu element. The caller is presented the output and can select this option by entering the proper DTMF sequence or verbally matching its grammar.

If the CED (caller entered digits) matches the grammar contained in the dtmf member, call processing is continued by the document located at the targetURI.

The targetURI can be a string literal or an expression that equates to the URI of the next VXML document to be processed.

Version:
2.0
Author:
Trip Gilman, Lonnie Pryor

Field Summary
 
Fields inherited from interface org.eclipse.vtp.framework.interactions.voice.vxml.VXMLConstants
EMPTY, FILE_EXT_GSL, FILLED_MODE_ALL, FILLED_MODE_ANY, GRAMMAR_MODE_DTMF, GRAMMAR_MODE_VOICE, METHOD_GET, METHOD_POST, MIME_TYPE_GSL, MIME_TYPE_SRGS, NAME_APPLICATION, NAME_ASSIGN, NAME_AUDIO, NAME_BARGEIN, NAME_BEEP, NAME_BLOCK, NAME_BRIDGE, NAME_CATCH, NAME_CHOICE, NAME_COMPLETETIMEOUT, NAME_COND, NAME_CONFIDENCELEVEL, NAME_COUNT, NAME_DEST, NAME_DISCONNECT, NAME_DTMF, NAME_DTMFTERM, NAME_ELSE, NAME_ELSEIF, NAME_ENCTYPE, NAME_ENUMERATE, NAME_ERROR, NAME_EVENT, NAME_EVENTEXPR, NAME_EXIT, NAME_EXPR, NAME_FIELD, NAME_FILLED, NAME_FINALSILENCE, NAME_FORM, NAME_GOTO, NAME_GRAMMAR, NAME_ID, NAME_IF, NAME_INCOMPLETETIMEOUT, NAME_INPUTMODES, NAME_INTERDIGITTIMEOUT, NAME_ITEM, NAME_MAXNBEST, NAME_MAXSPEECHTIMEOUT, NAME_MAXTIME, NAME_MENU, NAME_METHOD, NAME_MODE, NAME_NAME, NAME_NAMELIST, NAME_NEXT, NAME_NOINPUT, NAME_NOMATCH, NAME_ONE_OF, NAME_OPTION, NAME_PARAM, NAME_PROMPT, NAME_PROPERTY, NAME_RECORD, NAME_REPEAT, NAME_REPROMPT, NAME_RETURN, NAME_ROOT, NAME_RULE, NAME_SCOPE, NAME_SCRIPT, NAME_SENSITIVITY, NAME_SPEEDVSACCURACY, NAME_SRC, NAME_SUBDIALOG, NAME_SUBMIT, NAME_TERMCHAR, NAME_TERMTIMEOUT, NAME_THROW, NAME_TIMEOUT, NAME_TRANSFER, NAME_TYPE, NAME_VALUE, NAME_VAR, NAME_VERSION, NAME_VXML, NAMESPACE_URI_VXML, QNAME_XML_LANG, SCOPE_DIALOG, SCOPE_DOCUMENT, TYPE_CDATA, VERSION_2_0
 
Constructor Summary
Choice(java.lang.String targetURI)
          Creates a new instance of the Choice element.
Choice(java.lang.String targetURI, Grammar grammar)
          Creates a new instance of the Choice element.
Choice(java.lang.String targetURI, Output output)
          Creates a new instance of the Choice element.
Choice(java.lang.String targetURI, java.lang.String dtmf)
          Creates a new instance of the Choice element.
Choice(java.lang.String targetURI, java.lang.String dtmf, Grammar grammar)
          Creates a new instance of Choice element with the specified targetURI and grammars, but the output is left initialized to null.
Choice(java.lang.String targetURI, java.lang.String dtmf, Output output)
          Creates a new instance of Choice element with the specified targetURI, DTMF grammar, and output, but the other grammar is left initialized to null.
Choice(java.lang.String targetURI, java.lang.String dtmf, Output output, Grammar grammar)
          Creates a new instance of Choice element with the specified targetURI, grammars, and output.
 
Method Summary
 java.lang.String getDTMF()
          Returns the DTMF grammar associated with this Choice.
 Grammar getGrammar()
          Returns the grammar that describes what input selects this choice.
 Output getOutput()
          Returns the Output object to play to the caller to describe this choice
 java.lang.String getTargetURI()
          Returns the URI of the VXML document the call should be processed by if this Choice is selected.
 void setDTMF(java.lang.String dtmf)
          Set the simple DTMF grammar that governs the CED the caller uses to select this menu choice.
 void setGrammar(Grammar grammar)
          Sets the grammar that describes what input selects this choice.
 void setOutput(Output output)
          Sets the output to be rendered to the caller when this Choice is enumerated.
 void setTargetURI(java.lang.String targetURI)
          Sets the URI of the next vxml page to process if this menu choice is selected by the caller.
protected  void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
          Write the attribute members of this condition to the supplied set.
protected  void writeGrammar(org.xml.sax.ContentHandler outputHandler)
          Write the grammar in this choice to the specified content handler.
protected  void writeOutput(org.xml.sax.ContentHandler outputHandler)
          Write the output in this choice to the specified content handler.
 void writeWidget(org.xml.sax.ContentHandler outputHandler)
          Writes the content of this widget to an XML content handler.
 
Methods inherited from class org.eclipse.vtp.framework.interactions.core.support.Widget
toString, writeAttribute, writeChildren, writeChildren, writeWidget, writeWidget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Choice

public Choice(java.lang.String targetURI)
       throws java.lang.IllegalArgumentException,
              java.lang.NullPointerException
Creates a new instance of the Choice element. The targetURI is defined, but the grammars and output are left initially null.

Parameters:
targetURI - The URI of the next VXML document to process the call.
Throws:
java.lang.IllegalArgumentException - If supplied target URI is empty.
java.lang.NullPointerException - If supplied target URI is null.

Choice

public Choice(java.lang.String targetURI,
              java.lang.String dtmf)
       throws java.lang.IllegalArgumentException,
              java.lang.NullPointerException
Creates a new instance of the Choice element. The targetURI and DTMF grammar are set, but the other grammar and output are left initialized to null.

Parameters:
targetURI - The URI of the next VXML document to process the call.
dtmf - The DTMF grammar used to match against the caller's CED.
Throws:
java.lang.IllegalArgumentException - If supplied target URI is empty.
java.lang.IllegalArgumentException - If supplied DTMF value is empty.
java.lang.NullPointerException - If supplied target URI is null.

Choice

public Choice(java.lang.String targetURI,
              Output output)
       throws java.lang.IllegalArgumentException,
              java.lang.NullPointerException
Creates a new instance of the Choice element. The targetURI and output are set, but the grammars are left initialized to null.

Parameters:
targetURI - The URI of the next VXML document to process the call.
output - The TTS and audio output to play to the caller.
Throws:
java.lang.IllegalArgumentException - If supplied target URI is empty.
java.lang.NullPointerException - If supplied target URI is null.

Choice

public Choice(java.lang.String targetURI,
              Grammar grammar)
       throws java.lang.IllegalArgumentException,
              java.lang.NullPointerException
Creates a new instance of the Choice element. The targetURI and grammar are set, but the DTMF grammar and output are left initialized to null.

Parameters:
targetURI - The URI of the next VXML document to process the call.
grammar - The grammar that describes what input selects this choice.
Throws:
java.lang.IllegalArgumentException - If supplied target URI is empty.
java.lang.NullPointerException - If supplied target URI is null.

Choice

public Choice(java.lang.String targetURI,
              java.lang.String dtmf,
              Output output)
       throws java.lang.IllegalArgumentException,
              java.lang.NullPointerException
Creates a new instance of Choice element with the specified targetURI, DTMF grammar, and output, but the other grammar is left initialized to null.

Parameters:
targetURI - The URI of the next VXML document to process the call.
dtmf - The DTMF grammar used to match against the caller's CED.
output - The TTS and audio output to play to the caller.
Throws:
java.lang.IllegalArgumentException - If supplied target URI is empty.
java.lang.IllegalArgumentException - If supplied DTMF value is empty.
java.lang.NullPointerException - If supplied target URI is null.

Choice

public Choice(java.lang.String targetURI,
              java.lang.String dtmf,
              Grammar grammar)
       throws java.lang.IllegalArgumentException,
              java.lang.NullPointerException
Creates a new instance of Choice element with the specified targetURI and grammars, but the output is left initialized to null.

Parameters:
targetURI - The URI of the next VXML document to process the call.
dtmf - The DTMF grammar used to match against the caller's CED.
grammar - The grammar that describes what input selects this choice.
Throws:
java.lang.IllegalArgumentException - If supplied target URI is empty.
java.lang.IllegalArgumentException - If supplied DTMF value is empty.
java.lang.NullPointerException - If supplied target URI is null.

Choice

public Choice(java.lang.String targetURI,
              java.lang.String dtmf,
              Output output,
              Grammar grammar)
       throws java.lang.IllegalArgumentException,
              java.lang.NullPointerException
Creates a new instance of Choice element with the specified targetURI, grammars, and output.

Parameters:
targetURI - The URI of the next VXML document to process the call.
dtmf - The DTMF grammar used to match against the caller's CED.
output - The TTS and audio output to play to the caller.
grammar - The grammar that describes what input selects this choice.
Throws:
java.lang.IllegalArgumentException - If supplied target URI is empty.
java.lang.IllegalArgumentException - If supplied DTMF value is empty.
java.lang.NullPointerException - If supplied target URI is null.
Method Detail

getTargetURI

public java.lang.String getTargetURI()
Returns the URI of the VXML document the call should be processed by if this Choice is selected.

Returns:
URI of the target VMXL document.

getDTMF

public java.lang.String getDTMF()
Returns the DTMF grammar associated with this Choice.

Returns:
The DTMF grammar.

getOutput

public Output getOutput()
Returns the Output object to play to the caller to describe this choice

Returns:
The output to play to the caller.

getGrammar

public Grammar getGrammar()
Returns the grammar that describes what input selects this choice.

Returns:
The grammar that describes what input selects this choice

setTargetURI

public void setTargetURI(java.lang.String targetURI)
                  throws java.lang.IllegalArgumentException,
                         java.lang.NullPointerException
Sets the URI of the next vxml page to process if this menu choice is selected by the caller. Throws an IllegalArgumentException if the targetURI argument is null or an empty string.

Parameters:
targetURI - The URI of the next page to process
Throws:
java.lang.IllegalArgumentException - If supplied target URI is empty.
java.lang.NullPointerException - If supplied target URI is null.

setDTMF

public void setDTMF(java.lang.String dtmf)
             throws java.lang.IllegalArgumentException
Set the simple DTMF grammar that governs the CED the caller uses to select this menu choice.

Parameters:
dtmf - The simple DTMF grammar.
Throws:
java.lang.IllegalArgumentException - If supplied DTMF value is empty.

setOutput

public void setOutput(Output output)
Sets the output to be rendered to the caller when this Choice is enumerated.

Parameters:
output - The output to play to the caller.

setGrammar

public void setGrammar(Grammar grammar)
Sets the grammar that describes what input selects this choice.

Parameters:
grammar - The grammar that describes what input selects this choice.

writeWidget

public void writeWidget(org.xml.sax.ContentHandler outputHandler)
                 throws java.lang.NullPointerException,
                        org.xml.sax.SAXException
Description copied from class: Widget
Writes the content of this widget to an XML content handler.

Specified by:
writeWidget in class Widget
Parameters:
outputHandler - The handler to write this widget to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing of this widget fails.

writeAttributes

protected void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
Write the attribute members of this condition to the supplied set.

Parameters:
attributes - The attribute set to write to.
Throws:
java.lang.NullPointerException - If the supplied attribute set is null.

writeGrammar

protected void writeGrammar(org.xml.sax.ContentHandler outputHandler)
                     throws java.lang.NullPointerException,
                            org.xml.sax.SAXException
Write the grammar in this choice to the specified content handler.

Parameters:
outputHandler - The content handler to write to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing of one of the actions fails.

writeOutput

protected void writeOutput(org.xml.sax.ContentHandler outputHandler)
                    throws java.lang.NullPointerException,
                           org.xml.sax.SAXException
Write the output in this choice to the specified content handler.

Parameters:
outputHandler - The content handler to write to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing of one of the actions fails.